import { _decorator, Vec2, Component, UITransform, Vec3, CCInteger } from "cc";
const {ccclass, property} = _decorator;

@ccclass("NumberArray")
class NumberArray {
    @property([CCInteger])
    Array: number[] = [];
}

@ccclass
export default class PolygonNavData extends Component {

    @property([NumberArray])
    PathNodeLinks: NumberArray[] = [];

    public GenerateNavMeshData(nav2d:any)
    {
        this.PathNodeLinks = [];
		for (let index = 0; index < nav2d._pathNodes.length; index++) {
			const pathNode = nav2d._pathNodes[index];
			this.PathNodeLinks[index] = new NumberArray();
			for (let j = 0; j < pathNode.links.length; j++) {
				const link = pathNode.links[j];
				this.PathNodeLinks[index].Array.push(link);
			}
		}
		console.log("路径数据生成成功")
    }
}

